import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
    //按需引入
    { path: '/', redirect:'/login' },
    { path: '/login', component: () => import('@/views/login.vue') },
    { path: '/register', component: () => import('@/views/register.vue') },
    { path: '/personal', component: () => import('@/views/personal.vue') },
    { path: '/edit_profile', component: () => import('@/views/edit_profile.vue') },
    { path: '/index', component: () => import('@/views/index.vue') },
    { path: '/newsDetail', component: () => import('@/views/newsDetail.vue') },
    { path: '/myFollow', component: () => import('@/views/myFollow.vue') },
    { path: '/myStar', component: () => import('@/views/myStar.vue') },
    { path: '/comment', component: () => import('@/views/comment.vue') }

]

const router = new VueRouter({
    routes,
    // mode:history
})

export default router 